using System;
using System.Collections.Generic;
using System.Text;
using Arere.Core.Data;

namespace Arere.Core
{
    public class Player
    {
        private PlayerAdapter adapter;
        private Guid playerId;
        private string name;
        private Guid area;

        public Player(PlayerAdapter adapter, 
            Guid playerId, string name, Guid area)
        {
            this.adapter = adapter;
            this.name = name;
            this.area = area;
            this.playerId = playerId;
        }

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public Guid PlayerId
        {
            get { return this.playerId; }
        }

        private Guid Area
        {
            get { return this.area; }
            set 
            {
                if (this.adapter.ChangePlayerArea(this.playerId, value))
                    this.area = value;
            }
        }
   }
}
